package com.youbug.mall.product_pms.feign.impl;

import com.youbug.mall.order_oms.feign.IOrderProductFeignService;
import com.youbug.common.vo.SpuInfoVo;
import com.youbug.mall.product_pms.entity.PmsSpuInfo;
import com.youbug.mall.product_pms.service.IPmsSpuInfoService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderProductFeignServiceImpl implements IOrderProductFeignService {

    @Autowired
    private IPmsSpuInfoService pmsSpuInfoService;

    @Override
    public SpuInfoVo getSpuInfoBySkuId(Long skuId) {

        PmsSpuInfo spuInfo = pmsSpuInfoService.getSpuInfoBySkuId(skuId);

        SpuInfoVo infoVo = new SpuInfoVo();

        BeanUtils.copyProperties(spuInfo, infoVo);

        return infoVo;
    }
}
